/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import java.util.List;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.classic.Session;
import pojo.DanhMuc;
import util.HibernateUtil;

/**
 *
 * @author OSIRIS
 */
public class DanhMucDAO extends AbstractDAO{
    
    public DanhMucDAO() {
        super();
    }

    /**
     * Insert a new DanhMuc into the database.
     * @param info
     */
    public void create(DanhMuc info) throws DataAccessLayerException {
        super.saveOrUpdate(info);
    }


    /**
     * Delete a detached DanhMuc from the database.
     * @param info
     */
    public void delete(DanhMuc info) throws DataAccessLayerException {
        super.delete(info);
    }

    /**
     * Find an DanhMuc by its primary key.
     * @param id
     * @return
     */
    public DanhMuc find(Integer id) throws DataAccessLayerException {
        return (DanhMuc) super.find(DanhMuc.class, id);
    }

    /**
     * Updates the state of a detached DanhMuc.
     *
     * @param info
     */
    public void update(DanhMuc info) throws DataAccessLayerException {
        super.saveOrUpdate(info);
    }

    /**
     * Finds all DanhMucs in the database.
     * @return
     */
    public List findAll() throws DataAccessLayerException{
        return super.findAll(DanhMuc.class);
    }
}
